package com.juzi.staticinheritance.field_method;

public class Test {
    public static void main(String[] args) {
        //目标：理解继承后成员的访问特点，就近原则
        Orange o = new Orange();
        o.run();
        o.likeED();
        o.showName();
    }
}
class Animal{
    public String name = "植物";
    public void run(){
        System.out.println("(★ ω ★)  桔子爱吃熊  (￣(工)￣)");
    }
}
class Orange extends Animal{

    public String name = "桔子";

    public void likeED(){
        System.out.println("桔子有耳朵");
    }

    public void showName(){
        String name = "桔子种子";
        System.out.println(this.name);//当前子类名
        System.out.println(name);//局部名
        System.out.println(super.name);//父类名

        run();//子类的run
        super.run();//父类的
    }

    public void run(){
        System.out.println("桔子的夏天");
    }
}
